package com.seguriapp.dao;

import static org.hibernate.criterion.Restrictions.eq;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.seguriapp.base.GenericDaoImpl;
import com.seguriapp.entities.MenuLink;
import com.seguriapp.entities.MenuLinkRole;

/**
 * Data access object for {@link MenuLink} entities using Hibernate.
 * 
 * @author Tania Gonzales (taniadgv@gmail.com)
 */
@Repository
public class MenuLinkDaoImpl extends GenericDaoImpl<MenuLink> implements MenuLinkDao {

  public MenuLinkDaoImpl() {
    super(MenuLink.class);
  }

  @SuppressWarnings("unchecked")
  public List<MenuLink> getMenuLinkListByRole(final MenuLinkRole role) {
    return getSession().createCriteria(MenuLink.class).add(eq("role", role)).list();
  }

}
